import type { StoreListResponse, AddStoreParams, UpdateStoreParams, StoreResponse, DeleteStoreParams } from '@/types/store'
import { http } from '@/utils/http'

/**
 * 查询门店列表
 */
export const getStoreListAPI = () => {
  return http<StoreListResponse>({
    method: 'GET',
    url: '/shop/shop',
  })
}

/**
 * 新增门店
 * @param params 新增门店的参数
 */
export const addStoreAPI = (params: AddStoreParams) => {
  return http<StoreResponse>({
    method: 'POST',
    url: '/shop/shop',
    data: params,
  })
}

/**
 * 修改门店
 * @param params 修改门店的参数
 */
export const updateStoreAPI = (params: UpdateStoreParams) => {
  return http<StoreResponse>({
    method: 'PUT',
    url: '/shop/shop',
    data: params,
  })
}

/**
 * 删除门店
 * @param params 删除门店的参数
 */
export const deleteStoreAPI = (params: DeleteStoreParams) => {
  return http<StoreResponse>({
    method: 'DELETE',
    url: '/shop/shop',
    data: params,
  })
}
